Integrand size = 23, antiderivative size = 96 \[ \int \sqrt {a+a \sec (c+d x)} \tan ^2(c+d x) \, dx=-\frac {2 \sqrt {a} \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}+\frac {2 a \tan (c+d x)}{d \sqrt {a+a \sec (c+d x)}}+\frac {2 a^2 \tan ^3(c+d x)}{3 d (a+a \sec (c+d x))^{3/2}} \]
-2*arctan(a^(1/2)*tan(d*x+c)/(a+a*sec(d*x+c))^(1/2))*a^(1/2)/d+2*a*tan(d*x +c)/d/(a+a*sec(d*x+c))^(1/2)+2/3*a^2*tan(d*x+c)^3/d/(a+a*sec(d*x+c))^(3/2)
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 3.48 (sec) , antiderivative size = 226, normalized size of antiderivative = 2.35 \[ \int \sqrt {a+a \sec (c+d x)} \tan ^2(c+d x) \, dx=\frac {8 \sqrt {2} \left (\frac {1}{1+\sec (c+d x)}\right )^{7/2} \sqrt {a (1+\sec (c+d x))} \left (-\frac {\cos (c+d x) (7+3 \cos (c+d x)) \csc ^4\left (\frac {1}{2} (c+d x)\right ) \sec ^2\left (\frac {1}{2} (c+d x)\right ) \left (-3 \text {arctanh}\left (\sqrt {1-\sec (c+d x)}\right ) \cos (c+d x)+(-1+4 \cos (c+d x)) \sqrt {1-\sec (c+d x)}\right )}{24 \sqrt {1-\sec (c+d x)}}-\frac {4}{7} \operatorname {Hypergeometric2F1}\left (2,\frac {7}{2},\frac {9}{2},-2 \sec (c+d x) \sin ^2\left (\frac {1}{2} (c+d x)\right )\right ) \sec (c+d x) \tan ^2\left (\frac {1}{2} (c+d x)\right )\right ) \tan ^3(c+d x)}{3 d \left (1-\tan ^2\left (\frac {1}{2} (c+d x)\right )\right )^{5/2}} \]
(8*Sqrt[2]*((1 + Sec[c + d*x])^(-1))^(7/2)*Sqrt[a*(1 + Sec[c + d*x])]*(-1/ 24*(Cos[c + d*x]*(7 + 3*Cos[c + d*x])*Csc[(c + d*x)/2]^4*Sec[(c + d*x)/2]^ 2*(-3*ArcTanh[Sqrt[1 - Sec[c + d*x]]]*Cos[c + d*x] + (-1 + 4*Cos[c + d*x]) *Sqrt[1 - Sec[c + d*x]]))/Sqrt[1 - Sec[c + d*x]] - (4*Hypergeometric2F1[2, 7/2, 9/2, -2*Sec[c + d*x]*Sin[(c + d*x)/2]^2]*Sec[c + d*x]*Tan[(c + d*x)/ 2]^2)/7)*Tan[c + d*x]^3)/(3*d*(1 - Tan[(c + d*x)/2]^2)^(5/2))
Time = 0.25 (sec) , antiderivative size = 93, normalized size of antiderivative = 0.97, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3042, 4375, 363, 262, 216}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \tan ^2(c+d x) \sqrt {a \sec (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \cot \left (c+d x+\frac {\pi }{2}\right )^2 \sqrt {a \csc \left (c+d x+\frac {\pi }{2}\right )+a}dx\) |
\(\Big \downarrow \) 4375 |
\(\displaystyle -\frac {2 a^2 \int \frac {\tan ^2(c+d x) \left (\frac {a \tan ^2(c+d x)}{\sec (c+d x) a+a}+2\right )}{(\sec (c+d x) a+a) \left (\frac {a \tan ^2(c+d x)}{\sec (c+d x) a+a}+1\right )}d\left (-\frac {\tan (c+d x)}{\sqrt {\sec (c+d x) a+a}}\right )}{d}\) |
\(\Big \downarrow \) 363 |
\(\displaystyle -\frac {2 a^2 \left (\int \frac {\tan ^2(c+d x)}{(\sec (c+d x) a+a) \left (\frac {a \tan ^2(c+d x)}{\sec (c+d x) a+a}+1\right )}d\left (-\frac {\tan (c+d x)}{\sqrt {\sec (c+d x) a+a}}\right )-\frac {\tan ^3(c+d x)}{3 (a \sec (c+d x)+a)^{3/2}}\right )}{d}\) |
\(\Big \downarrow \) 262 |
\(\displaystyle -\frac {2 a^2 \left (-\frac {\int \frac {1}{\frac {a \tan ^2(c+d x)}{\sec (c+d x) a+a}+1}d\left (-\frac {\tan (c+d x)}{\sqrt {\sec (c+d x) a+a}}\right )}{a}-\frac {\tan ^3(c+d x)}{3 (a \sec (c+d x)+a)^{3/2}}-\frac {\tan (c+d x)}{a \sqrt {a \sec (c+d x)+a}}\right )}{d}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle -\frac {2 a^2 \left (\frac {\arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{a^{3/2}}-\frac {\tan ^3(c+d x)}{3 (a \sec (c+d x)+a)^{3/2}}-\frac {\tan (c+d x)}{a \sqrt {a \sec (c+d x)+a}}\right )}{d}\) |
(-2*a^2*(ArcTan[(Sqrt[a]*Tan[c + d*x])/Sqrt[a + a*Sec[c + d*x]]]/a^(3/2) - Tan[c + d*x]/(a*Sqrt[a + a*Sec[c + d*x]]) - Tan[c + d*x]^3/(3*(a + a*Sec[ c + d*x])^(3/2))))/d
3.2.43.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x) ^(m - 1)*((a + b*x^2)^(p + 1)/(b*(m + 2*p + 1))), x] - Simp[a*c^2*((m - 1)/ (b*(m + 2*p + 1))) Int[(c*x)^(m - 2)*(a + b*x^2)^p, x], x] /; FreeQ[{a, b , c, p}, x] && GtQ[m, 2 - 1] && NeQ[m + 2*p + 1, 0] && IntBinomialQ[a, b, c , 2, m, p, x]
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2), x _Symbol] :> Simp[d*(e*x)^(m + 1)*((a + b*x^2)^(p + 1)/(b*e*(m + 2*p + 3))), x] - Simp[(a*d*(m + 1) - b*c*(m + 2*p + 3))/(b*(m + 2*p + 3)) Int[(e*x)^ m*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m, p}, x] && NeQ[b*c - a*d , 0] && NeQ[m + 2*p + 3, 0]
Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n _.), x_Symbol] :> Simp[-2*(a^(m/2 + n + 1/2)/d) Subst[Int[x^m*((2 + a*x^2 )^(m/2 + n - 1/2)/(1 + a*x^2)), x], x, Cot[c + d*x]/Sqrt[a + b*Csc[c + d*x] ]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m/2] && I ntegerQ[n - 1/2]
Leaf count of result is larger than twice the leaf count of optimal. \(185\) vs. \(2(84)=168\).
Time = 4.73 (sec) , antiderivative size = 186, normalized size of antiderivative = 1.94
method | result | size |
default | \(-\frac {\left (3 \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {2}\, \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )}{\sqrt {\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1}}\right ) \left (\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1\right )^{\frac {3}{2}}-2 \left (1-\cos \left (d x +c \right )\right )^{3} \csc \left (d x +c \right )^{3}+6 \csc \left (d x +c \right )-6 \cot \left (d x +c \right )\right ) \sqrt {-\frac {2 a}{\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1}}}{3 d \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )-1\right ) \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )+1\right )}\) | \(186\) |
-1/3/d*(3*2^(1/2)*arctanh(2^(1/2)/((1-cos(d*x+c))^2*csc(d*x+c)^2-1)^(1/2)* (-cot(d*x+c)+csc(d*x+c)))*((1-cos(d*x+c))^2*csc(d*x+c)^2-1)^(3/2)-2*(1-cos (d*x+c))^3*csc(d*x+c)^3+6*csc(d*x+c)-6*cot(d*x+c))*(-2*a/((1-cos(d*x+c))^2 *csc(d*x+c)^2-1))^(1/2)/(-cot(d*x+c)+csc(d*x+c)-1)/(csc(d*x+c)-cot(d*x+c)+ 1)
Time = 0.30 (sec) , antiderivative size = 283, normalized size of antiderivative = 2.95 \[ \int \sqrt {a+a \sec (c+d x)} \tan ^2(c+d x) \, dx=\left [\frac {3 \, {\left (\cos \left (d x + c\right )^{2} + \cos \left (d x + c\right )\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right ) + 1}\right ) + 2 \, \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} {\left (2 \, \cos \left (d x + c\right ) + 1\right )} \sin \left (d x + c\right )}{3 \, {\left (d \cos \left (d x + c\right )^{2} + d \cos \left (d x + c\right )\right )}}, \frac {2 \, {\left (3 \, {\left (\cos \left (d x + c\right )^{2} + \cos \left (d x + c\right )\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) + \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} {\left (2 \, \cos \left (d x + c\right ) + 1\right )} \sin \left (d x + c\right )\right )}}{3 \, {\left (d \cos \left (d x + c\right )^{2} + d \cos \left (d x + c\right )\right )}}\right ] \]
[1/3*(3*(cos(d*x + c)^2 + cos(d*x + c))*sqrt(-a)*log((2*a*cos(d*x + c)^2 + 2*sqrt(-a)*sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*cos(d*x + c)*sin(d*x + c) + a*cos(d*x + c) - a)/(cos(d*x + c) + 1)) + 2*sqrt((a*cos(d*x + c) + a )/cos(d*x + c))*(2*cos(d*x + c) + 1)*sin(d*x + c))/(d*cos(d*x + c)^2 + d*c os(d*x + c)), 2/3*(3*(cos(d*x + c)^2 + cos(d*x + c))*sqrt(a)*arctan(sqrt(( a*cos(d*x + c) + a)/cos(d*x + c))*cos(d*x + c)/(sqrt(a)*sin(d*x + c))) + s qrt((a*cos(d*x + c) + a)/cos(d*x + c))*(2*cos(d*x + c) + 1)*sin(d*x + c))/ (d*cos(d*x + c)^2 + d*cos(d*x + c))]
\[ \int \sqrt {a+a \sec (c+d x)} \tan ^2(c+d x) \, dx=\int \sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )} \tan ^{2}{\left (c + d x \right )}\, dx \]
\[ \int \sqrt {a+a \sec (c+d x)} \tan ^2(c+d x) \, dx=\int { \sqrt {a \sec \left (d x + c\right ) + a} \tan \left (d x + c\right )^{2} \,d x } \]
-1/6*(3*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1) ^(3/4)*(2*d*integrate((((cos(6*d*x + 6*c)*cos(2*d*x + 2*c) + 2*cos(4*d*x + 4*c)*cos(2*d*x + 2*c) + cos(2*d*x + 2*c)^2 + sin(6*d*x + 6*c)*sin(2*d*x + 2*c) + 2*sin(4*d*x + 4*c)*sin(2*d*x + 2*c) + sin(2*d*x + 2*c)^2)*cos(5/2* arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c))) + (cos(2*d*x + 2*c)*sin(6*d*x + 6*c) + 2*cos(2*d*x + 2*c)*sin(4*d*x + 4*c) - cos(6*d*x + 6*c)*sin(2*d*x + 2*c) - 2*cos(4*d*x + 4*c)*sin(2*d*x + 2*c))*sin(5/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c))))*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2 *c) + 1)) - ((cos(2*d*x + 2*c)*sin(6*d*x + 6*c) + 2*cos(2*d*x + 2*c)*sin(4 *d*x + 4*c) - cos(6*d*x + 6*c)*sin(2*d*x + 2*c) - 2*cos(4*d*x + 4*c)*sin(2 *d*x + 2*c))*cos(5/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c))) - (cos(6 *d*x + 6*c)*cos(2*d*x + 2*c) + 2*cos(4*d*x + 4*c)*cos(2*d*x + 2*c) + cos(2 *d*x + 2*c)^2 + sin(6*d*x + 6*c)*sin(2*d*x + 2*c) + 2*sin(4*d*x + 4*c)*sin (2*d*x + 2*c) + sin(2*d*x + 2*c)^2)*sin(5/2*arctan2(sin(2*d*x + 2*c), cos( 2*d*x + 2*c))))*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)))/ (((2*(2*cos(4*d*x + 4*c) + cos(2*d*x + 2*c))*cos(6*d*x + 6*c) + cos(6*d*x + 6*c)^2 + 4*cos(4*d*x + 4*c)^2 + 4*cos(4*d*x + 4*c)*cos(2*d*x + 2*c) + co s(2*d*x + 2*c)^2 + 2*(2*sin(4*d*x + 4*c) + sin(2*d*x + 2*c))*sin(6*d*x + 6 *c) + sin(6*d*x + 6*c)^2 + 4*sin(4*d*x + 4*c)^2 + 4*sin(4*d*x + 4*c)*sin(2 *d*x + 2*c) + sin(2*d*x + 2*c)^2)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos...
\[ \int \sqrt {a+a \sec (c+d x)} \tan ^2(c+d x) \, dx=\int { \sqrt {a \sec \left (d x + c\right ) + a} \tan \left (d x + c\right )^{2} \,d x } \]
Timed out. \[ \int \sqrt {a+a \sec (c+d x)} \tan ^2(c+d x) \, dx=\int {\mathrm {tan}\left (c+d\,x\right )}^2\,\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}} \,d x \]